package br.com.assemble.hermeserp.model.pojos.pessoas;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import br.com.assemble.hermeserp.ejb.annotation.DaoClass;
import br.com.assemble.hermeserp.model.BasePojo;
import br.com.assemble.hermeserp.model.pojos.comercial.Vendedor;
import br.com.assemble.hermeserp.model.pojos.controle.Usuario;


/**
 * The persistent class for the EMPRESAS database table.
 * 
 */
@Entity
@Table(name="EMPRESAS")
@DaoClass(value="EmpresaDao", pu="hermes-pu")
public class Empresa extends BasePojo implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="EMP_IDENTIFY", unique=true, nullable=false)
	private BigInteger empIdentify;

	@Column(name="EMP_CODIGO", nullable=false)
	private Integer empCodigo;

	@Column(name="EMP_MATRIZ", nullable=false, length=1)
	private Integer empMatriz;

	//bi-directional one-to-one association to PessoaJuridica
	@OneToOne(mappedBy="empresa", fetch=FetchType.LAZY)
	private PessoaJuridica pessoaJuridica;

	//bi-directional many-to-one association to Usuario
	@OneToMany(mappedBy="empresa")
	private List<Usuario> usuarioCollection;

	//bi-directional many-to-one association to Vendedor
	@OneToMany(mappedBy="empresa")
	private List<Vendedor> vendedorCollection;

    public Empresa() {
    }

	public BigInteger getEmpIdentify() {
		return this.empIdentify;
	}

	public void setEmpIdentify(BigInteger empIdentify) {
		this.empIdentify = empIdentify;
	}

	public Integer getEmpCodigo() {
		return this.empCodigo;
	}

	public void setEmpCodigo(Integer empCodigo) {
		this.empCodigo = empCodigo;
	}

	public Integer getEmpMatriz() {
		return this.empMatriz;
	}

	public void setEmpMatriz(Integer empMatriz) {
		this.empMatriz = empMatriz;
	}

	public PessoaJuridica getPessoaJuridica() {
		return this.pessoaJuridica;
	}

	public void setPessoaJuridica(PessoaJuridica pessoaJuridica) {
		this.pessoaJuridica = pessoaJuridica;
	}
	
	public List<Usuario> getUsuarioCollection() {
		return this.usuarioCollection;
	}

	public void setUsuarioCollection(List<Usuario> usuarioCollection) {
		this.usuarioCollection = usuarioCollection;
	}
	
	public List<Vendedor> getVendedorCollection() {
		return this.vendedorCollection;
	}

	public void setVendedorCollection(List<Vendedor> vendedorCollection) {
		this.vendedorCollection = vendedorCollection;
	}
	
}